#导包
from api.litemall_login import LiteLogin
from api.litemall_cartadd import Lite_Cart
#创建测试类
class TestLiteLogin:
    token=None
    def setup_method(self):
        #创建面向对象
        self.lite_login=LiteLogin()
        self.lite_cart=Lite_Cart()
        json_data={"username":"user123","password":"user123"}
        TestLiteLogin.token=self.lite_login.login(json_data).json()["data"]["token"]

    def teardown(self):
        pass
    def test01_cart(self):
        json_cart={"goodsId":1181000,"number":1,"productId":2}
        resp1=self.lite_cart.cart_add(TestLiteLogin.token,json_cart)
        assert 200==resp1.status_code

